﻿@model IEnumerable<TS2015.Models.TbMailServer>
@{
    AjaxOptions aj = new AjaxOptions
    {
        InsertionMode = InsertionMode.Replace,
        UpdateTargetId = "content-main",
        LoadingElementId = "loading-icon",
        OnFailure = "AjaxFailure",
        OnBegin = "AjaxBegin",
        OnComplete = "AjaxComplete"
    };
    ViewBag.Title = "Máy chủ mail";
}
<p>
    @Ajax.ActionLink("Tạo mới", "Create",null,aj, new { @class = "btn btn-danger" })
</p>
<table class="table">
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.Host)
        </th> 
        <th>
            @Html.DisplayNameFor(model => model.UserName)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.DisplayName)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.EnableSSL)
        </th>     
        <th>
            @Html.DisplayNameFor(model => model.Port)
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.Host)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.UserName)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.DisplayName)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.EnableSSL)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Port)
        </td>
        <td>
            @Html.ActionLink("Sửa", "Edit", new { id = item.ID }, new { @class = "label label-danger" }) | 
            @Html.ActionLink("Xóa", "Delete", new { id = item.ID }, new { @class = "label label-danger" })
        </td>
    </tr>
}
</table>
